/*
 * main.c
 *
 *  Created on: 2011-11-6
 *      Author: root
 */

/*

中国有句俗语叫“三天打鱼两天晒网”。
某人从1990年1月1日起开始“三天打鱼两天晒网”，
问这个人在以后的某一天中是“打鱼”还是“晒网”？
*/
#include<stdio.h>

#define DEBUG 1

int getDaysOfMonth(year, month)
{
	switch(month){
	case 2:
			if((year%400==0))
				return 29;
			else if((year%4==0)&&(year%100))
				return 29;
			else
				return 28;
			break;
	case 1:
	case 3:
	case 5:
	case 7:
	case 8:
	case 10:
	case 12:
		return 31;
		break;
	case 4:
	case 6:
	case 9:
	case 11:
		return 30;
		break;
	}
	return 0;
}
void to_do_or_not_to_do(int year, int month, int day)
{
	int years, years_fix, total,i,j = -1;
	years = year - 1990;
	years_fix = (years + 1)/4;
	total = years * 365 + years_fix;
	for(i = 1; i<month; i++)
	{
		total += getDaysOfMonth(year, i);
	}
	total += day;
	j = (total-1) % 5;
	if(j<=2&&j>=0)
		printf("打鱼\n");
	else if(j>=3 && j<5)
		printf("晒网\n");
	else
		printf("ERROR!\n");
	if(DEBUG)
	{
		printf("从%d到1990年经历了%d年，共经过了%d个闰年(不包括%d年),共%d天\n",year,years,years_fix,year,total);
	}
}

int valid(year,month,day)
{
	if(year>=1900)
		if(month>=1 && month <= 12)
			if(day>=1 && day<= getDaysOfMonth(year,month))
				return 1;
	return 0;
}

int main(int argc, char **argv) {
	int year, month, day;
	year = month = day = 0;
//	day = getDaysOfMonth(1991,2);
//	return 0;
	printf("请输入年月日,以空格分开\n");
	while(scanf("%d %d %d",&year,&month,&day)!=EOF)
	{
		if(valid(year,month,day))
		{
			to_do_or_not_to_do(year,month,day);
		}
		else
		{
			printf("请按照正确的格式输入合法的数据！\n");
		}
		printf("请输入年月日,以空格分开\n");
	}
	return 0;
}
